﻿@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
}
@{
    Layout = null;
    ViewData["Title"] = "主页";
}
<!DOCTYPE html>
<html class="no-js css-menubar" lang="zh-cn" runat="server">
<head>
    <link href="~/admui-13945148017-1592211513218/public/themes/global/css/bootstrap.css" rel="stylesheet" />
    <link href="~/admui-13945148017-1592211513218/public/fonts/web-icons/web-icons.css" rel="stylesheet" />
    <link href="~/admui-13945148017-1592211513218/public/themes/base/css/site.css" rel="stylesheet" />
    <link href="~/admui-13945148017-1592211513218/public/vendor/animsition/scss/animsition.css" rel="stylesheet" />
    <link href="~/admui-13945148017-1592211513218/public/css/login.css" rel="stylesheet" />
    <script src="~/admui-13945148017-1592211513218/public/vendor/jquery/jquery.min.js"></script>
    <script src="~/admui-13945148017-1592211513218/public/vendor/bootstrap/bootstrap.bundle.min.js"></script>
    <script src="~/admui-13945148017-1592211513218/public/vendor/jquery-validation/jquery.validate.min.js"></script>
    <script src="~/admui-13945148017-1592211513218/public/vendor/jquery-validation/localization/messages_zh.js"></script>
    <title>重新登录</title>

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="~/admui-13945148017-1592211513218/public/themes/global/css/bootstrap.css">

    <!-- 字体图标 CSS -->
    <link rel="stylesheet" href="~/admui-13945148017-1592211513218/public/fonts/web-icons/web-icons.css">

    <!-- Site CSS -->
    <link rel="stylesheet" href="~/admui-13945148017-1592211513218/public/themes/base/css/site.css" id="admui-siteStyle">

    <!-- 插件 CSS -->
    <link rel="stylesheet" href="~/admui-13945148017-1592211513218/public/vendor/animsition/animsition.css">

    <!-- Page CSS -->
    <link rel="stylesheet" href="~/admui-13945148017-1592211513218/public/css/locked.css">
</head>

<body class="page-locked layout-full page-dark" onkeydown="checkInfo(event,this)">

    <div class="page animation-fade vertical-align text-center animsition-fade h-full">
        <div class="page-content vertical-align-middle">
            <div class="avatar avatar-lg">
                <img src="~/admui-13945148017-1592211513218/public/images/avatar.svg" alt="Admui">
            </div>
            <h4 class="locked-user" id="yhming"></h4>
            <form method="post" role="form" runat="server">
                <div class="input-group">
                    <input type="password" class="form-control last" id="inputPassword" runat="server" name="password" placeholder="请输入密码以继续操作">
                    <span class="input-group-append">
                        <button id="Button2" type="button" class="btn btn-primary" onclick="Login()" >登陆</button>
                    </span>
                </div>
            </form>
            <p>
                <a href="/Login/Login?tuichu=tuichu">或者使用其他账号登录</a>
            </p>
        </div>
    </div>
</body>
</html>
<script type="text/javascript">
    $(document).ready(function () {
        $('#inputPassword').focus();
        bangding()
    })

    //function keyLogin() {
    //    if (event.keyCode == 13) {
    //        document.getElementById("Button2").click();
    //    }
    //}
    //onkeydown = "keyLogin()"
    checkInfo = function (event, self) {
        if (event.keyCode == 13) {
            document.getElementById("Button2").click();
            event.cancleBubble = true;
            event.returnValue = false;
            return false;
        }
    }
    //绑定
    function bangding() {
        $.ajax({
            url: "../Login/bangding",
            data: {},
            type: "post",
            dataType: "json",
            success: function (response) {

                $(response).each(function (key) {
                    if (key == 0) {
                        $("#yhming").text(response[key])
                    }
                })
            }
        });
    }
    //登录
    function Login() {
        if ($("#inputPassword").val() == "") {
            alert("密码不能为空！")
        } else {
            zhuangtai = "选中"
            $.ajax({
                url: "../Login/DengLuCX",
                data: { "name": $("#yhming").text(), "pwd": $("#inputPassword").val(), zhuangtai: zhuangtai },
                type: "post",
                dataType: "text",
                success: function (response) {
                    if (response == "成功") {
                        location.href = '../Home/FenXiBaoBiao';
                    } else if (response == "密码错误") {
                        location.href = '../Login/LoginChongXin';
                    }
                }
            });
        }
    }
</script>